<!-- angular通过ng-modal添加模态框时，不需要外层的div，只需从modal-content开始即可 -->
<style>
    
</style>
<div class="modal-content">
    <div class="modal-header">
        <h3 class="modal-title">{{info.type=="TEST" ? "版本提交测试" : "版本提交转测"}}</h3>
    </div>
    <form class="modal-body form-horizontal">
        <div class="panel panel-default">
            <div class="panel-heading">
                工程信息
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <div class="alert alert-danger" role="alert" ng-if="info.type=='INTEGRATION'">
                        提交转测版本说明：
                        <br>
                        提交转测版本，以中午12点为界，每天上午和下午都可以提交一个版本。当上午或者下午已经提交过一次版本后，
                        除非是解决阻塞性bug，不允许提交版本。多余的提交版本，默认认为都是解决阻塞性bug版本。
                        <br>
                        例：上午已经提交了一个转测版本，如果有新版本要提交，新版本是解决阻塞bug时，可以提交，提交时有弹窗确认。
                        如果不是解决阻塞bug，则要等到下午再提交版本。
                    </div>
                </div>
                <div class="line-lg pull-in" ng-if="info.type=='INTEGRATION'"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">工程名：</label>
                    <div class="col-sm-10">
                        <label class="control-label">
                            {{info.projectName}}
                        </label>
                    </div>
                </div>
                <div class="line-lg pull-in" style="margin-top: 8px;margin-bottom: 8px;"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">{{info.type=="TEST" ? "当前提测版本：" : "当前转测版本："}}</label>
                    <div class="col-sm-10">
                        <label class="control-label">
                                {{info.type=="TEST" ? info.projectInfo.to_test_edition : info.projectInfo.to_integration_edition}}
                        </label>
                    </div>
                </div>
                <div class="line-lg pull-in" style="margin-top: 8px;margin-bottom: 8px;"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">新提交版本：</label>
                    <div class="col-sm-10">
                        <label class="control-label" ng-if="info.type=='TEST' && info.projectInfo.package_type != 'ad'">{{info.selectEdition.showNum}}</label>
                        <ui-select ng-if="info.type=='INTEGRATION' || (info.type=='TEST' && info.projectInfo.package_type == 'ad')" ng-model="info.selectEdition" ng-change="editionChange();">
                            <ui-select-match placeholder="选择主干工程">{{$select.selected.showNum}}</ui-select-match>
                            <ui-select-choices repeat="edition in info.editionList | filter: $select.search|limitTo:15">
                                <span ng-bind-html="edition.showNum | highlight: $select.search"></span>
                            </ui-select-choices>
                        </ui-select>
                    </div>
                </div>
                <div class="line-lg pull-in" ng-if="info.type=='TEST'"></div>
                <div class="form-group" ng-if="info.type=='TEST'">
                    <label class="col-sm-2 control-label"></label>
                    <div class="col-sm-10">
                        <label class="control-label" style="color: #a94442;">
                            <i class="fa fa-exclamation-circle"></i> 只有构建成功的临时版本才能提交测试.提交时,会自动生成版本号！
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="panel panel-default" ng-if="info.status && info.selectEdition.editionNum != undefined">
            <div class="panel-heading">附加说明</div>
            <div class="panel-body">
                <div class="panel panel-default">
                    <div class="panel-heading">提交说明(必填,请说明这次提交的修改点,测试点以及注意事项)</div>
                    <div class="panel-body">
                        <textarea class="form-control" wrap="off" style="overflow-y: scroll; width: 100%;" ng-model="info.otherDesc" rows="2"></textarea>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">SQL变动</div>
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-sm-12">请选择这个版本需要测试人员执行的sql脚本 
                                <button type="button" class="btn btn-success btn-xs">
                                    <i class="fa fa-refresh" popover="刷新sql文件列表" popover-trigger="mouseenter" ng-click="getSqlList()"></i>
                                </button>
                            </div>
                        </div>
                        <div class="line-lg pull-in" style="margin-top: 8px;margin-bottom: 8px;"></div>
                        <table class="table table-hover table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th style="width: 5%;"><input class="checkbox" ng-model="info.checkAllSql" ng-true-value="true" ng-false-value="false" type="checkbox" ng-click="checkAll('sql')"></th>
                                    <th style="width: 10%;">序号</th>
                                    <th>sql脚本</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-if="info.sqlList.length == 0">
                                    <td colspan="3">sql脚本数据为空！</td>
                                </tr>
                                <tr ng-if="info.sqlList.length != 0" ng-repeat="sql in info.sqlList track by $index">
                                    <td><input ng-model="sql.isCheck" ng-true-value="true" ng-false-value="false" type="checkbox"></td>
                                    <td>{{$index+1}}</td>
                                    <td><a href="javascript:void(0)" ng-click="downloadSqlFile(sql);">{{sql.file_name}}(点击下载)</a></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">配置变动</div>
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-sm-12">请选择这个版本需要测试人员修改的配置项 
                                <button type="button" class="btn btn-success btn-xs">
                                    <i class="fa fa-refresh" popover="刷新配置列表" popover-trigger="mouseenter" ng-click="getConfigList()"></i>
                                </button>
                            </div>
                        </div>
                        <div class="line-lg pull-in" style="margin-top: 8px;margin-bottom: 8px;"></div>
                        <table class="table table-hover table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th style="width: 5%;"><input ng-model="info.checkAllConfig" ng-true-value="true" ng-false-value="false" type="checkbox" ng-click="checkAll('config')"></th>
                                    <th style="width: 8%;">序号</th>
                                    <th style="width: 20%;">配置文件</th>
                                    <th style="width: 25%;">配置项</th>
                                    <th style="width: 40%;">配置说明</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-if="info.configList.length == 0">
                                    <td colspan="5">配置数据为空！</td>
                                </tr>
                                <tr ng-if="info.configList.length != 0" ng-repeat="config in info.configList track by $index">
                                    <td><input ng-model="config.isCheck" ng-true-value="true" ng-false-value="false" type="checkbox"/></td>
                                    <td>{{$index+1}}</td>
                                    <td>{{config.fileName}}</td>
                                    <td>{{config.key}}={{config.value}}</td>
                                    <td><input type="text" class="form-control" ng-model="config.desc"/></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary" ng-click="saveClick()" ng-disabled="!info.status || info.selectEdition.editionNum == undefined">确定</button>
        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancelClick()">取消</button>
    </div>
</div>
